<template>
  <el-tabs v-model="normal">
    <el-tab-pane label="术前评估" name="first">
      <PatientSqpgList :patientId="patientId" :patientName="patientName" />
    </el-tab-pane>
    <el-tab-pane label="前列腺Ca激光局灶消融术/冷冻术" name="second">
      <PatientQlxcajgjzxrsldsList :patientId="patientId" :patientName="patientName" />
    </el-tab-pane>
    <el-tab-pane label="内分泌治疗" name="seven">
      <PatientNfmzlList :patientId="patientId" :patientName="patientName" />
    </el-tab-pane>
    <el-tab-pane label="化学治疗" name="third">
      <PatientHxzlList :patientId="patientId" :patientName="patientName" />
    </el-tab-pane>
    <el-tab-pane label="化疗" name="fourth">
      <PatientHlList :patientId="patientId" :patientName="patientName" />
    </el-tab-pane>
    <el-tab-pane label="根治性手术" name="five">
      <PatientGzxssList :patientId="patientId" :patientName="patientName" />
    </el-tab-pane>
    <el-tab-pane label="放射治疗" name="six">
      <PatientFszlList :patientId="patientId" :patientName="patientName" />
    </el-tab-pane>
  </el-tabs>
</template>

<script setup lang="ts">

import PatientSqpgList from "@/views/business/userpatient/medicalvisitrecord/components/sqpg/index.vue";
import PatientQlxcajgjzxrsldsList from "@/views/business/userpatient/medicalvisitrecord/components/qlxcajgjzxrslds/index.vue";
import PatientHxzlList from "@/views/business/userpatient/medicalvisitrecord/components/hxzl/index.vue";
import PatientHlList from "@/views/business/userpatient/medicalvisitrecord/components/hl/index.vue";
import PatientGzxssList from "@/views/business/userpatient/medicalvisitrecord/components/gzxss/index.vue";
import PatientFszlList from "@/views/business/userpatient/medicalvisitrecord/components/fszl/index.vue";
import PatientNfmzlList from "@/views/business/userpatient/medicalvisitrecord/components/nfmzl/index.vue";

const message = useMessage() // 消息弹窗

const route = useRoute() // 路由
const router = useRouter() // 路由

const patientId = ref();
const patientName = ref();

const normal = ref('first');

/** 就诊人 列表 */
defineOptions({ name: 'MedicalVisitRecord' })

/** 初始化 **/
onMounted(() => {
  // 如果就诊人 ID 不存在，显示错误提示并关闭页面
  if (!route.query.id) {
    message.error('就诊人 ID 不存在，无法查看就诊记录')
    // 关闭当前路由，返回到就诊人列表页面
    router.push({ name: 'UserPatient' })
    return
  }

  // 从路由参数中获取就诊人 ID
  patientId.value = route.query.id as any
  patientName.value = route.query.name as any
})
</script>

<style scoped lang="scss">

</style>
